package com.ruoyi.xsp.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.xsp.mapper.XspUserConcernedMapper;
import com.ruoyi.xsp.domain.XspUserConcerned;
import com.ruoyi.xsp.service.IXspUserConcernedService;
import com.ruoyi.common.core.text.Convert;

/**
 * 关注管理Service业务层处理
 *
 * @author zhiminhu
 * @date 2021-01-22
 */
@Service
public class XspUserConcernedServiceImpl implements IXspUserConcernedService {
    @Autowired
    private XspUserConcernedMapper xspUserConcernedMapper;

    /**
     * 查询关注管理
     *
     * @param id 关注管理ID
     * @return 关注管理
     */
    @Override
    public XspUserConcerned selectXspUserConcernedById(Long id) {
        return xspUserConcernedMapper.selectXspUserConcernedById(id);
    }

    /**
     * 查询关注管理列表
     *
     * @param xspUserConcerned 关注管理
     * @return 关注管理
     */
    @Override
    public List<XspUserConcerned> selectXspUserConcernedList(XspUserConcerned xspUserConcerned) {
        return xspUserConcernedMapper.selectXspUserConcernedList(xspUserConcerned);
    }

    @Override
    public Long selectXspUserConcernedListCount(XspUserConcerned xspUserConcerned) {
        return xspUserConcernedMapper.selectXspUserConcernedListCount(xspUserConcerned);
    }

    /**
     * 新增关注管理
     *
     * @param xspUserConcerned 关注管理
     * @return 结果
     */
    @Override
    public int insertXspUserConcerned(XspUserConcerned xspUserConcerned) {
        xspUserConcerned.setCreateTime(DateUtils.getNowDate());
        return xspUserConcernedMapper.insertXspUserConcerned(xspUserConcerned);
    }

    /**
     * 修改关注管理
     *
     * @param xspUserConcerned 关注管理
     * @return 结果
     */
    @Override
    public int updateXspUserConcerned(XspUserConcerned xspUserConcerned) {
        return xspUserConcernedMapper.updateXspUserConcerned(xspUserConcerned);
    }

    /**
     * 删除关注管理对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteXspUserConcernedByIds(String ids) {
        return xspUserConcernedMapper.deleteXspUserConcernedByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除关注管理信息
     *
     * @param id 关注管理ID
     * @return 结果
     */
    @Override
    public int deleteXspUserConcernedById(Long id) {
        return xspUserConcernedMapper.deleteXspUserConcernedById(id);
    }
}
